package com.onlyxiahui.common.utils.extend.change;

import java.util.Map;
import java.util.Set;

/**
 * 
 * Description <br>
 * Date 2020-11-09 18:48:28<br>
 * 
 * @author XiaHui [onlovexiahui@qq.com]<br>
 * @since 1.0.0
 */
public class AddFormatImpl implements AddFormat {

	@Override
	public String getContent(Map<String, String> propertyDescribeMap, Map<String, Object> data) {
		String content = "";

		if (null != data) {

			StringBuilder sb = new StringBuilder();

			Set<String> keySet = data.keySet();
			for (String name : keySet) {

				String text = (null != propertyDescribeMap) ? propertyDescribeMap.get(name) : null;
				text = null == text ? "" : text;
				Object value = data.get(name);

				sb.append(text);
				sb.append("(");
				sb.append(name);
				sb.append("):");
				sb.append("=[");
				sb.append(value);
				sb.append("]；");
				sb.append("\n");
			}
			content = sb.toString();
		}
		return content;
	}
}
